#pragma once 
#include"RBTree.hh"


template<class K , class V>
class map
{
public:
	struct MapKeyOfT
	{
		const K& operator()(const pair<K, V>& kv)
		{
			return kv.first;
		}
	};
public:
	typedef typename RBTree<K, pair<K, V>, MapKeyOfT>::iterator iterator;
	iterator begin()
	{
		return _m.begin();
	}
	iterator end()
	{
		return _m.end();
	}
	bool Insert(const pair<K, V>& kv)
	{
		return _m.Insert(kv);
	}
private:
	RBTree<K, pair<K, V>, MapKeyOfT> _m;
};